<template>
  <view>
    <biaotou title="异常路赔事件"></biaotou>
    <inputForm v-model="form" ref="form" :list="list">
    </inputForm>
  </view>
</template>

<script>
import inputForm from "@/components/inputForm.vue";
import {zhuangtaiyichangJson} from "../mock/mockJson";
import Biaotou from "./biaotou.vue";
import {getRoadAndHeadByDepartId, selectDicByCode} from "../../../api/lupeiwenshu";

export default {
  components: {
    Biaotou,
    inputForm,
  },
  data() {
    return {
      form: {
        discussLocat: '',
        factThree: ''
      },
      list: [
        {
          label: '异常状态：',
          prop: 'discussLocat',
          type: 'select',
          dicData: zhuangtaiyichangJson,
          mark: '24小时内由于特殊原因无法办结的可标记为异常状态,异常状态可以添加说明备注'
        },
        {
          label: '备注：',
          prop: 'factThree',
          type: 'textarea',
          hidden: true,
          mark: '备注内容会自动同步到文书备注中'
        },
      ],
      rules: {
        discussLocat: [
          {
            required: true,
            message: "请输入"
          }
        ]
      }
    };
  },
  watch: {
    'form.discussLocat'(val) {
      this.list[1].hidden = val !== '0'
    }
  },
  methods: {
    submit() {
      this.$refs.form.$refs.form.validate(valid => {
        if (valid) {
          console.log('验证通过');
        } else {
          console.log('验证失败');
        }
      });
    }
  }
  ,
  mounted() {
    // this.$refs.form.$refs.form.setRules(this.rules);
  }
  ,

}
;
</script>
